/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import org.hibernate.Criteria;
import org.orm.PersistentException;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class DiaAgregadoCriteria extends AbstractORMCriteria {
	public final IntegerExpression ID;
	public final DoubleExpression gastoSUM;
	public final StringExpression unidade;
	public final DoubleExpression precoSUM;
	public final DateExpression data;
	public final DoubleExpression gastoAVG;
	public final DoubleExpression precoAVG;
	
	public DiaAgregadoCriteria(Criteria criteria) {
		super(criteria);
		ID = new IntegerExpression("ID", this);
		gastoSUM = new DoubleExpression("gastoSUM", this);
		unidade = new StringExpression("unidade", this);
		precoSUM = new DoubleExpression("precoSUM", this);
		data = new DateExpression("data", this);
		gastoAVG = new DoubleExpression("gastoAVG", this);
		precoAVG = new DoubleExpression("precoAVG", this);
	}
	
	public DiaAgregadoCriteria(PersistentSession session) {
		this(session.createCriteria(DiaAgregado.class));
	}
	
	public DiaAgregadoCriteria() throws PersistentException {
		this(smartgrid.SmartgridPersistentManager.instance().getSession());
	}
	
	public ContractCriteria createContractCriteria() {
		return new ContractCriteria(createCriteria("contract"));
	}
	
	public DiaAgregado uniqueDiaAgregado() {
		return (DiaAgregado) super.uniqueResult();
	}
	
	public DiaAgregado[] listDiaAgregado() {
		java.util.List list = super.list();
		return (DiaAgregado[]) list.toArray(new DiaAgregado[list.size()]);
	}
}

